using System;
using System.Collections.Generic;
using System.IO;
using log4net;

namespace Reactor.ServiceGrid.FileSystem
{
    public interface IFileSystem
    {
        string Root { get; }
        ILog Logger { get; }
        void DeleteDirectory(string path, bool recursive);

        /// <summary>
        /// Gets the paths to all files in the root of this instance.
        /// </summary>
        /// <returns></returns>
        IEnumerable<string> GetFiles();

        /// <summary>
        /// Gets the paths to all files in the specified path of this instance.
        /// </summary>
        /// <param name="path">The path to search.</param>
        /// <returns></returns>
        IEnumerable<string> GetFiles(string path);

        IEnumerable<string> GetFiles(string path, string filter);
        IEnumerable<string> GetDirectories(string path);
        string GetFullPath(string path);
        void DeleteFile(string path);
        bool FileExists(string path);
        bool DirectoryExists(string path);
        void AddFile(string path, Stream stream);
        Stream OpenFile(string path);
        DateTimeOffset GetLastModified(string path);
        DateTimeOffset GetCreated(string path);
    }
}
